package com.wsj.service.impl;

import java.util.List;

import com.wsj.dao.IHomeSiteAdAutopalyDao;
import com.wsj.service.IHomeSiteAdAutopalyServ;
import com.wsj.util.exception.BusinessException;
import com.wsj.web.vo.homeSite.HomeSiteAdAutopaly;

public class HomeSiteAdAutopalyServImpl implements IHomeSiteAdAutopalyServ {

	private IHomeSiteAdAutopalyDao homeSiteAdAutopalyDao ;
	
	public void delete(Integer id) throws BusinessException {
		if(id != null && !(new Integer(0).equals(id))){
			this.homeSiteAdAutopalyDao.delete(id);
		}
	}

	@SuppressWarnings("unchecked")
	public List<HomeSiteAdAutopaly> loadAllList() throws BusinessException {
		List list = this.homeSiteAdAutopalyDao.loadAllList();
		return list;
	}

	public HomeSiteAdAutopaly loadById(Integer id) throws BusinessException {
		if(id != null && !(new Integer(0).equals(id))){
			return this.homeSiteAdAutopalyDao.loadById(id);
		}
		return null;
	}

	public void saveOrUpdate(HomeSiteAdAutopaly hs) throws BusinessException {
		if(hs != null ){
			this.homeSiteAdAutopalyDao.saveOrUpdate(hs);
		}
	}

	public IHomeSiteAdAutopalyDao getHomeSiteAdAutopalyDao() {
		return homeSiteAdAutopalyDao;
	}

	public void setHomeSiteAdAutopalyDao(
			IHomeSiteAdAutopalyDao homeSiteAdAutopalyDao) {
		this.homeSiteAdAutopalyDao = homeSiteAdAutopalyDao;
	}

	public List<HomeSiteAdAutopaly> loadTop(Integer top) throws BusinessException {
		if(top != null  && !(new Integer(0).equals(top))){
			return this.homeSiteAdAutopalyDao.loadTop(top);
		}
		return null;
	}

}
